import {ref} from 'vue'
export const useThrottle = (fn:Function,delay:number) => {
    let isThrottle=ref(false)
    return (...args:any[])=>{
        if(isThrottle.value){
            return
        }
        isThrottle.value=true
        setTimeout(()=>{
            fn(...args)
            isThrottle.value=false
        },delay)
    }
}
